<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<script type="text/javascript">
$(query);
function query() {
	   
	var v = ${object.getlimitscope};
	if (v == 1) {
		$("#spxz1").hide();
		$("#spxzb1").hide();
		$("#flxz1").hide();
		$("#flxzb1").hide();
	} else if (v == 2) {
		$("#spxz1").hide();
		$("#spxzb1").hide();
		$("#flxz1").show();
		$("#flxzb1").show();
	} else {
		$("#flxz1").hide();
		$("#flxzb1").hide();
		$("#spxz1").show();
		$("#spxzb1").show();
	}
	var v = ${object.uselimitscope};
	if (v == 1) {
		$("#spxz").hide();
		$("#spxzb").hide();
		$("#flxz").hide();
		$("#flxzb").hide();
	} else if (v == 2) {
		$("#spxz").hide();
		$("#spxzb").hide();
		$("#flxz").show();
		$("#flxzb").show();
	} else {
		$("#flxz").hide();
		$("#flxzb").hide();
		$("#spxz").show();
		$("#spxzb").show();
	}
	var v = ${object.validtime0};
	if (v == 1) {
		$("#validtime1").show();
		$("#validtime2").hide();
	} else if (v == 2) {
		$("#validtime1").hide();
		$("#validtime2").show();
	}
	var v = ${object.type};
	if (v == 5) {
		$("#getlimitmoney").hide();
		$("#getlimitscope").hide();
		$("#uselimitusersscope").hide();
		$("#uselimitmoney").hide();
		$("#mz").hide();
		$("#zk").show();
	} else if (v == 4) {
		$("#getlimitmoney").hide();
		$("#getlimitscope").hide();
		$("#uselimitusersscope").show();
		$("#uselimitmoney").show();
		$("#mz").show();
		$("#zk").hide();
	} else if (v == 1) {
		$("#getlimitmoney").show();
		$("#getlimitscope").show();
		$("#uselimitusersscope").hide();
		$("#uselimitmoney").show();
		$("#mz").show();
		$("#zk").hide();
	} else {
		$("#getlimitmoney").hide();
		$("#getlimitscope").hide();
		$("#uselimitusersscope").hide();
		$("#uselimitmoney").show();
		$("#mz").show();
		$("#zk").hide();
	}
	
	$("#addForm").validate({
		rules : {
			limitcount : {
				digits : true
			},
			count : {
				digits : true
			},
		},
		messages : {
			title : {
				required : "请输入优惠券名称"
			},
			limitcount : {
				required : "请输入限领数量"
			},
		},
		submitHandler:function(form){
			$(form).ajaxSubmit({
				success:function(data){
					switch(data.flag){
					case 2:
						Kit.alert("请选择有效期的有效区间");
						return;
					case 3:
						Kit.alert("请填写有效期的有效天数");
						return;
				
					case -1:
						Kit.alert("网络繁忙...，请重试");
						editDialog.close();
						return;
					case 0:
						onEditSuccess(data.object);
						editDialog.close();
						return;
					}
				}
			});
		}
	});
	
}
	$("#deleteTableafl1").click(function() {
		var check = document.getElementsByName("checksfl1");
		var ths = check.length;
		var numb = parseFloat($("#chooseNumfl1").html());
		for (var i = 0; i < check.length; i++) {
			if (check[i].checked) {
				document.getElementById('tableafl1').deleteRow(i);
				i--;
				numb--;
				if(numb<0){
					numb=0;
				}
			}
		}
		$("#chooseNumfl1").text((numb));
		$("#storeidfl1").val((numb));
	})

	$("#deleteTableasp1").click(function() {
		var check = document.getElementsByName("checkssp1");
		var ths = check.length;
		var numb = parseFloat($("#chooseNumsp1").html());
		for (var i = 0; i < check.length; i++) {
			if (check[i].checked) {
				document.getElementById('tableasp1').deleteRow(i);
				i--;
				numb--;
				if(numb<0){
					numb=0;
				}
			}
		}
		$("#chooseNumsp1").text((numb));
		$("#storeidsp1").val((numb));
	})

	$("#deleteTableafl").click(function() {
		var check = document.getElementsByName("checksfl");
		var ths = check.length;
		var numb = parseFloat($("#chooseNumfl").html());
		for (var i = 0; i < check.length; i++) {
			if (check[i].checked) {
				document.getElementById('tableafl').deleteRow(i);
				i--;
				numb--;
				if(numb<0){
					numb=0;
				}
			}
		}
		$("#chooseNumfl").text((numb));
		$("#storeidfl").val((numb));
	})

	$("#deleteTableasp").click(function() {
		var check = document.getElementsByName("checkssp");
		var ths = check.length;
		var numb = parseFloat($("#chooseNumsp").html());
		for (var i = 0; i < check.length; i++) {
			if (check[i].checked) {
				document.getElementById('tableasp').deleteRow(i);
				i--;
				numb--;
				if(numb<0){
					numb=0;
				}
			}
		}
		$("#chooseNumsp").text((numb));
		$("#storeidsp").val((numb));
	})

	var addCategoryDialog;
	function addCategory() {
		addCategoryDialog = Kit.dialog("添加分类",
				"${BASE_PATH}/pref/chooseCategory", {
					closable : true,
					size : 'size-wide'
				}).open();
	}
	function onCategoryChoosed(id, categoryName) {
		var trs = $("#tableafl1 tr");
		var array = new Array();
		var numb = parseFloat($("#chooseNumfl1").html());
		for (var i = 0; i < trs.length; i++) {
			var tds = $(trs[i]).children();
			var sid = $(tds[0]).find("#ids").val();
			array.push(sid);
		}
		if (contains(array, id)) {
			alert("该分类已添加");
		} else {
			var tr = "<tr><td style=\"font-size: 14px;text-align: center;\"><input type=\"checkbox\" id=\"ids\" checked=\"checked\" name=\"checksfl1\" value='"+id+"'/>"
					+ "</td><td style=\"font-size: 14px;text-align: center;\">"
					+ id
					+ "</td><td style=\"font-size: 14px;text-align: center;\">"
					+ categoryName + "</td></tr>";
			$("#tableafl1").append(tr);
			$("#chooseNumfl1").text((numb + 1));
			$("#storeidfl1").val((numb + 1));
		}
	}

	var addGoodDialog;
	function addGood() {
		addGoodDialog = Kit.dialog("添加商品", "${BASE_PATH}/pref/chooseGood", {
			closable : true,
			size : 'size-wide'
		}).open();
	}

	function onGoodChoosed(id, name, marketPrice) {

		var trs = $("#tableasp1 tr");
		var array = new Array();
		var numb = parseFloat($("#chooseNumsp1").html());
		for (var i = 0; i < trs.length; i++) {
			var tds = $(trs[i]).children();
			var sid = $(tds[0]).find("#ids").val();
			array.push(sid);
		}
		if (contains(array, id)) {
			alert("该商品已添加");
		} else {
			var tr = "<tr><td style=\"font-size: 14px;text-align: center;\"><input type=\"checkbox\" id=\"ids\" checked=\"checked\" name=\"checkssp1\" value='"+id+"'/>"
					+ "</td><td style=\"font-size: 14px;text-align: center;\">"
					+ id
					+ "</td><td style=\"font-size: 14px;text-align: center;\">"
					+ name
					+ "</td><td style=\"font-size: 14px;text-align: center;\">"
					+ marketPrice + "</td></tr>";
			$("#tableasp1").append(tr);
			$("#chooseNumsp1").text((numb + 1));
			$("#storeidsp1").val((numb + 1));
		}
	}

	var addCategoryaDialog;
	function addCategorya() {
		addCategoryaDialog = Kit.dialog("添加分类a",
				"${BASE_PATH}/pref/chooseCategorya", {
					closable : true,
					size : 'size-wide'
				}).open();
	}
	function onCategoryaChoosed(id, categoryName) {
		var trs = $("#tableafl tr");
		var array = new Array();
		var numb = parseFloat($("#chooseNumfl").html());
		for (var i = 0; i < trs.length; i++) {
			var tds = $(trs[i]).children();
			var sid = $(tds[0]).find("#ids").val();
			array.push(sid);
		}
		if (contains(array, id)) {
			alert("该分类已添加");
		} else {
			var tr = "<tr><td style=\"font-size: 14px;text-align: center;\"><input type=\"checkbox\" id=\"ids\" checked=\"checked\" name=\"checksfl\" value='"+id+"'/>"
					+ "</td><td style=\"font-size: 14px;text-align: center;\">"
					+ id
					+ "</td><td style=\"font-size: 14px;text-align: center;\">"
					+ categoryName + "</td></tr>";
			$("#tableafl").append(tr);
			$("#chooseNumfl").text((numb + 1));
			$("#storeidfl").val((numb + 1));
		}
	}

	var addGoodaDialog;
	function addGooda() {
		addGoodaDialog = Kit.dialog("添加商品a", "${BASE_PATH}/pref/chooseGooda", {
			closable : true,
			size : 'size-wide'
		}).open();
	}

	function onGoodaChoosed(id, name, marketPrice) {

		var trs = $("#tableasp tr");
		var array = new Array();
		var numb = parseFloat($("#chooseNumsp").html());
		for (var i = 0; i < trs.length; i++) {
			var tds = $(trs[i]).children();
			var sid = $(tds[0]).find("#ids").val();
			array.push(sid);
		}
		if (contains(array, id)) {
			alert("该商品已添加");
		} else {
			var tr = "<tr><td style=\"font-size: 14px;text-align: center;\"><input type=\"checkbox\" id=\"ids\" checked=\"checked\" name=\"checkssp\" value='"+id+"'/>"
					+ "</td><td style=\"font-size: 14px;text-align: center;\">"
					+ id
					+ "</td><td style=\"font-size: 14px;text-align: center;\">"
					+ name
					+ "</td><td style=\"font-size: 14px;text-align: center;\">"
					+ marketPrice + "</td></tr>";
			$("#tableasp").append(tr);
			$("#chooseNumsp").text((numb + 1));
			$("#storeidsp").val((numb + 1));
		}
	}

	function contains(arr, obj) {
		var i = arr.length;
		while (i--) {
			if (arr[i] === obj) {
				return true;
			}
		}
		return false;
	}

	
	$(".getlimitscope").click(function() {
		var v = $('input[name="scope1"]').filter(':checked').val();
		if (v == 1) {
			$("#spxz1").hide();
			$("#spxzb1").hide();
			$("#flxz1").hide();
			$("#flxzb1").hide();
		} else if (v == 2) {
			$("#spxz1").hide();
			$("#spxzb1").hide();
			$("#flxz1").show();
			$("#flxzb1").show();
		} else {
			$("#flxz1").hide();
			$("#flxzb1").hide();
			$("#spxz1").show();
			$("#spxzb1").show();
		}
	});
	$(".uselimitscope").click(function() {
		var v = $('input[name="scope2"]').filter(':checked').val();
		if (v == 1) {
			$("#spxz").hide();
			$("#spxzb").hide();
			$("#flxz").hide();
			$("#flxzb").hide();
		} else if (v == 2) {
			$("#spxz").hide();
			$("#spxzb").hide();
			$("#flxz").show();
			$("#flxzb").show();
		} else {
			$("#flxz").hide();
			$("#flxzb").hide();
			$("#spxz").show();
			$("#spxzb").show();
		}
	});
	$(".validtime").click(function() {
		var v = $('input[name="validtime0"]').filter(':checked').val();
		if (v == 1) {
			$("#validtime1").show();
			$("#validtime2").hide();
		} else if (v == 2) {
			
			$("#validtime1").hide();
			$("#validtime2").show();
		}
	});
	$(".qtype").change(function() {
		var v = $('#typeselectpoint option:selected').val();
		if (v == 5) {
			$("#getlimitmoney").hide();
			$("#getlimitscope").hide();
			$("#uselimitusersscope").hide();
			$("#uselimitmoney").hide();
			$("#mz").hide();
			$("#zk").show();
		} else if (v == 4) {
			$("#getlimitmoney").hide();
			$("#getlimitscope").hide();
			$("#uselimitusersscope").show();
			$("#uselimitmoney").show();
			$("#mz").show();
			$("#zk").hide();
		} else if (v == 1) {
			$("#getlimitmoney").show();
			$("#getlimitscope").show();
			$("#uselimitusersscope").hide();
			$("#uselimitmoney").show();
			$("#mz").show();
			$("#zk").hide();
		} else {
			$("#getlimitmoney").hide();
			$("#getlimitscope").hide();
			$("#uselimitusersscope").hide();
			$("#uselimitmoney").show();
			$("#mz").show();
			$("#zk").hide();
		}

	});
</script>
<form id="addForm" action="${BASE_PATH}/pref/doEdit" method="post"
	class="form-horizontal">
	<div class="form-group">
		<label class="col-sm-3 control-label"><span
			style="margin-right: 10px; color: red;">*</span>优惠券名称</label>
		<div class="col-sm-9">
			<input type="text" name="title" value="${object.title}"
				class="form-control" placeholder="优惠券名称" required maxlength="20">
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-3 control-label">优惠券类型</label>
		<div class="col-sm-9">
			<select id="typeselectpoint" name="typeselectpoint"
				class="selectpicker form-control qtype" data-width="210">

				<option value="1" <c:if test="${object.type ==1 }">selected</c:if>>购物赠券</option>
				<option value="2" <c:if test="${object.type ==2 }">selected</c:if>>注册赠券</option>
				<option value="3" <c:if test="${object.type ==3 }">selected</c:if>>全场赠券</option>
				<option value="4" <c:if test="${object.type ==4 }">selected</c:if>>会员赠券</option>
				<option value="5" <c:if test="${object.type ==5 }">selected</c:if>>折扣赠券</option>
			</select>
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-3 control-label">适用平台</label>
		<div class="col-sm-9">
			<select id="scopeselectpoint" name="scopeselectpoint"
				class="selectpicker form-control" data-width="210">
				<option value="1"
					<c:if test="${object.usescope ==1 }">selected</c:if>>全平台</option>
				<option value="2"
					<c:if test="${object.usescope ==2 }">selected</c:if>>PC端</option>
				<option value="3"
					<c:if test="${object.usescope ==3 }">selected</c:if>>移动端</option>
			</select>
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-3 control-label">总发行量</label>
		<div class="col-sm-9">
			<input type="text" id="count" name="count" value="${object.count}"
				class="form-control" placeholder="" maxlength="50">
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-3 control-label">发行时间</label>
		<div class="col-sm-8" style="margin-left: 0px">
			<input type="text" id="starttime" name="starttime"
				value="${object.starttime}"
				class="form-control search-input width120 datetimepicker"
				data-format="yyyy-mm-dd" maxlength="20"> <label
				class="search-label">至</label><input type="text" id="endtime"
				name="endtime" value="${object.endtime}"
				class="form-control search-input width120 datetimepicker"
				data-format="yyyy-mm-dd" maxlength="20">
		</div>

	</div>



	<div class="form-group">
		<label class="col-sm-3 control-label"><span
			style="margin-right: 10px; color: red;">*</span>有效期</label>
		<div class="col-sm-9 validtime">
			<label><input name="validtime0" type="radio" value="1"
				<c:if test="${object.validtime0 ==1 }">checked</c:if> />有效时间</label> <label><input
				name="validtime0" type="radio" value="2"
				<c:if test="${object.validtime0 ==2 }">checked</c:if> />固定天数 </label>
		</div>
	</div>
	<div id="validtime1" class="form-group">
		<div class="col-sm-3"></div>
		<div class="col-sm-9">
			<label class="search-label"></label><input type="text"
				id="validstarttime" name="validstarttime"
				value="${object.validstarttime}"
				class="form-control search-input width120 datetimepicker"
				data-format="yyyy-mm-dd"  required> <label
				class="search-label">至</label><input type="text" id="validendtime"
				name="validendtime" value="${object.validendtime}"
				class="form-control search-input width120 datetimepicker"
				data-format="yyyy-mm-dd"  required>
		</div>
	</div>
	<div id="validtime2" class="form-group">
		<div class="col-sm-3"></div>
		<div class="col-sm-3">
			<input type="text" id="validday" name="validday"
				value="${object.validday}" class="form-control" placeholder=""
				maxlength="30" required >
		</div>
		<label class="col-sm-1 control-label">天</label>
	</div>
	<div class="form-group">
		<label class="col-sm-3 control-label">获取方式</label>
		<div class="col-sm-9">
			<ul class="iCheckList">
				<li><input type="radio" class="iCheck" name="method" value="1"
					<c:if test="${object.method ==1 }">checked</c:if>>&nbsp;消费</li>
				<li><input type="radio" class="iCheck" name="method" value="2"
					<c:if test="${object.method ==2 }">checked</c:if>>&nbsp;注册</li>
				<li><input type="radio" class="iCheck" name="method" value="3"
					<c:if test="${object.method ==3 }">checked</c:if>>&nbsp;邀请</li>
			</ul>
		</div>
	</div>
	<div id="mz" class="form-group">
		<label class="col-sm-3 control-label">面值</label>
		<div class="col-sm-9">
			<input type="text" id="values" name="values" value="${object.values}"
				class="form-control" placeholder="面值" maxlength="30">
		</div>
	</div>
	<div id="zk" class="form-group">
		<label class="col-sm-3 control-label">折扣</label>
		<div class="col-sm-9">
			<input type="text" id="discount" name="discount"
				value="${object.discount}" class="form-control" placeholder="折扣"
				maxlength="30">
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-3 control-label"><span
			style="margin-right: 10px; color: red;">*</span>每人限领</label>
		<div class="col-sm-2">
			<input type="text" id="limitcount" name="limitcount"
				value="${object.limitcount}" class="form-control" placeholder=""
				maxlength="30">
		</div>
		<label class="col-sm-1 control-label">张</label>
	</div>

	<div id="uselimitusersscope" class="form-group">
		<label class="col-sm-3 control-label"><span
			style="margin-right: 10px; color: red;">*</span>参与会员</label>
		<div class="col-sm-9 ">
			<label><input class="iCheck" name="huiyuan" type="checkbox"
				value="1" <c:if test="${object.method ==1 }">checked</c:if> /> 全部会员</label>
			<label><input class="iCheck" name="huiyuan" type="checkbox"
				value="2" <c:if test="${object.method ==2 }">checked</c:if> /> 普通会员</label>
			<label><input class="iCheck" name="huiyuan" type="checkbox"
				value="3" <c:if test="${object.method ==3 }">checked</c:if> /> 黄金会员</label>
			<label><input class="iCheck" name="huiyuan" type="checkbox"
				value="3" <c:if test="${object.method ==4 }">checked</c:if> /> 钻石会员</label>
		</div>
	</div>
	<div id="getlimitmoney" class="form-group">
		<label class="col-sm-3 control-label">获取门槛</label> <label
			class="col-sm-1 control-label">满</label>
		<div class="col-sm-3">
			<input type="text" id="getlimitmoney" name="getlimitmoney"
				value="${object.getlimitmoney}" class="form-control" placeholder=""
				maxlength="5">
		</div>
		<label class="col-sm-2 control-label">元可获得</label>
	</div>
	<div id="getlimitscope" class="form-group">
		<label class="col-sm-3 control-label">购物赠券商品范围</label>
		<div class="col-sm-9 getlimitscope" id="getlimitscope"
			name="getlimitscope">
			<label><input name="scope1" type="radio" value="1"
				<c:if test="${object.getlimitscope ==1 }">checked</c:if> />&nbsp;全平台</label>
			<label><input name="scope1" type="radio" value="2"
				<c:if test="${object.getlimitscope ==2 }">checked</c:if> />&nbsp;指定分类</label>
			<label><input name="scope1" type="radio" value="3"
				<c:if test="${object.getlimitscope ==3 }">checked</c:if> />&nbsp;指定商品</label>
		</div>
	</div>
	<div id="flxz1" class="form-group">
		<label class="col-sm-2 control-label"></label>
		<div class="col-sm-9">
			<input type="button" value="增加分类" onclick="addCategory();"
				style="background-color: #0080ff; color: white; border: 2px solid; background-image: linear-gradient(to bottom, #5bc0de 0, #428bca 100%);" />
			<span>已选分类(<span id="chooseNumfl1" name="chooseNumfl1">${object.getlimitcategoriessum}</span>)
			</span> <input type='button' value='删除分类' id='deleteTableafl1'
				style="background-color: #ff8080; color: white; border: 2px solid; background-image: linear-gradient(to bottom, #ff8080 0, #ff0000 100%);" />
			<input type="text" id="storeidfl1" name="storeidfl1" hidden="hidden"
				value="0" />
		</div>
	</div>
	<div id="flxzb1" class="form-group">
		<label class="col-sm-2 control-label"></label>
		<div class="col-sm-9">
			<table id="tableafl1" style="width: 100%" border="1px;">
				<tr>
					<th style="width: 5%; font-size: 14px; text-align: center;"><input
						type="checkbox" name="checksfl1" hidden="hidden" />选择</th>
					<th style="width: 15%; font-size: 14px; text-align: center;">分类ID</th>
					<th style="width: 20%; font-size: 14px; text-align: center;">分类名称</th>
				</tr>
				<c:if test="${fn:length(getlimitcategories) > 0}">
					<c:forEach var="fl1" items="${getlimitcategories}" varStatus="s">
						<tr>
							<td style="font-size: 14px; text-align: center;"><input
								type="checkbox" id="ids" checked="checked" name="checksfl1"
								value="${fl1.categoryId}"></td>
							<td style="font-size: 14px; text-align: center;">${fl1.categoryId }</td>
							<td style="font-size: 14px; text-align: center;">${fl1.categoryName}</td>
						</tr>
					</c:forEach>
				</c:if>
			</table>
		</div>
	</div>
	<div id="spxz1" class="form-group">
		<label class="col-sm-2 control-label"></label>
		<div class="col-sm-9">
			<input type="button" value="增加商品" onclick="addGood();"
				style="background-color: #0080ff; color: white; border: 2px solid; background-image: linear-gradient(to bottom, #5bc0de 0, #428bca 100%);" />
			<span>已选商品(<span id="chooseNumsp1" name="chooseNumsp1">${object.getlimitgoodssum}</span>)
			</span> <input type='button' value='删除商品' id='deleteTableasp1'
				style="background-color: #ff8080; color: white; border: 2px solid; background-image: linear-gradient(to bottom, #ff8080 0, #ff0000 100%);" />
			<input type="text" id="storeidsp1" name="storeidsp1" hidden="hidden"
				value="0" />
		</div>
	</div>
	<div id="spxzb1" class="form-group">
		<label class="col-sm-2 control-label"></label>
		<div class="col-sm-9">
			<table id="tableasp1" style="width: 100%" border="1px;">
				<tr>
					<th style="width: 5%; font-size: 14px; text-align: center;"><input
						type="checkbox" name="checkssp1" hidden="hidden" />选择</th>
					<th style="width: 15%; font-size: 14px; text-align: center;">商品ID</th>
					<th style="width: 20%; font-size: 14px; text-align: center;">商品名称</th>
					<th style="width: 15%; font-size: 14px; text-align: center;">商品价格</th>
				</tr>
				<c:if test="${fn:length(getlimitgoods) > 0}">
					<c:forEach var="sp1" items="${getlimitgoods}" varStatus="s">
						<tr>
							<td style="font-size: 14px; text-align: center;"><input
								type="checkbox" id="ids" checked="checked" name="checkssp1"
								value="${sp1.id}"></td>
							<td style="font-size: 14px; text-align: center;">${sp1.id }</td>
							<td style="font-size: 14px; text-align: center;">${sp1.name}</td>
							<td style="font-size: 14px; text-align: center;">${sp1.marketPrice}</td>
						</tr>
					</c:forEach>
				</c:if>
			</table>
		</div>
	</div>
	<div id="uselimitmoney" class="form-group">
		<label class="col-sm-3 control-label">适用门槛</label> <label
			class="col-sm-1 control-label">满</label>
		<div class="col-sm-3">
			<input type="text" id="uselimitmoney" name="uselimitmoney"
				value="${object.uselimitmoney}" class="form-control" placeholder=""
				maxlength="5">
		</div>
		<label class="col-sm-2 control-label">元可用</label>
	</div>
	<div class="form-group">
		<label class="col-sm-3 control-label">可使用范围</label>
		<div class="col-sm-9 uselimitscope" id="uselimitscope"
			name="uselimitscope">
			<label><input name="scope2" type="radio" value="1"
				<c:if test="${object.uselimitscope ==1 }">checked</c:if> />&nbsp;全平台</label>
			<label><input name="scope2" type="radio" value="2"
				<c:if test="${object.uselimitscope ==2 }">checked</c:if> />&nbsp;指定分类</label>
			<label><input name="scope2" type="radio" value="3"
				<c:if test="${object.uselimitscope ==3 }">checked</c:if> />&nbsp;指定商品</label>
		</div>
	</div>
	<div id="flxz" class="form-group">
		<label class="col-sm-2 control-label"></label>
		<div class="col-sm-9">
			<input type="button" value="增加分类" onclick="addCategorya();"
				style="background-color: #0080ff; color: white; border: 2px solid; background-image: linear-gradient(to bottom, #5bc0de 0, #428bca 100%);" />
			<span>已选分类(<span id="chooseNumfl" name="chooseNumfl">${object.uselimitcategoriessum}</span>)
			</span> <input type='button' value='删除分类' id='deleteTableafl'
				style="background-color: #ff8080; color: white; border: 2px solid; background-image: linear-gradient(to bottom, #ff8080 0, #ff0000 100%);" />
			<input type="text" id="storeidfl" name="storeidfl" hidden="hidden"
				value="0" />
		</div>
	</div>
	<div id="flxzb" class="form-group">
		<label class="col-sm-2 control-label"></label>
		<div class="col-sm-9">
			<table id="tableafl" style="width: 100%" border="1px;">
				<tr>
					<th style="width: 5%; font-size: 14px; text-align: center;"><input
						type="checkbox" name="checksfl" hidden="hidden" />选择</th>
					<th style="width: 15%; font-size: 14px; text-align: center;">分类ID</th>
					<th style="width: 20%; font-size: 14px; text-align: center;">分类名称</th>
				</tr>
				<c:if test="${fn:length(uselimitcategories) > 0}">
					<c:forEach var="fl" items="${uselimitcategories}" varStatus="s">
						<tr>
							<td style="font-size: 14px; text-align: center;"><input
								type="checkbox" id="ids" checked="checked" name="checksfl"
								value="${fl.categoryId}"></td>
							<td style="font-size: 14px; text-align: center;">${fl.categoryId }</td>
							<td style="font-size: 14px; text-align: center;">${fl.categoryName}</td>
						</tr>
					</c:forEach>
				</c:if>
			</table>
		</div>
	</div>
	<div id="spxz" class="form-group">
		<label class="col-sm-2 control-label"></label>
		<div class="col-sm-9">
			<input type="button" value="增加商品" onclick="addGooda();"
				style="background-color: #0080ff; color: white; border: 2px solid; background-image: linear-gradient(to bottom, #5bc0de 0, #428bca 100%);" />
			<span>已选商品(<span id="chooseNumsp" name="chooseNumsp">${object.uselimitgoodssum}</span>)
			</span> <input type='button' value='删除商品' id='deleteTableasp'
				style="background-color: #ff8080; color: white; border: 2px solid; background-image: linear-gradient(to bottom, #ff8080 0, #ff0000 100%);" />
			<input type="text" id="storeidsp" name="storeidsp" hidden="hidden"
				value="0" />
		</div>
	</div>
	<div id="spxzb" class="form-group">
		<label class="col-sm-2 control-label"></label>
		<div class="col-sm-9">
			<table id="tableasp" style="width: 100%" border="1px;">
				<tr>
					<th style="width: 5%; font-size: 14px; text-align: center;"><input
						type="checkbox" name="checkssp" hidden="hidden" />选择</th>
					<th style="width: 15%; font-size: 14px; text-align: center;">商品ID</th>
					<th style="width: 20%; font-size: 14px; text-align: center;">商品名称</th>
					<th style="width: 15%; font-size: 14px; text-align: center;">商品价格</th>
				</tr>
				<c:if test="${fn:length(uselimitgoods) > 0}">
					<c:forEach var="sp" items="${uselimitgoods}" varStatus="s">
						<tr>
							<td style="font-size: 14px; text-align: center;"><input
								type="checkbox" id="ids" checked="checked" name="checkssp"
								value="${sp.id}"></td>
							<td style="font-size: 14px; text-align: center;">${sp.id }</td>
							<td style="font-size: 14px; text-align: center;">${sp.name}</td>
							<td style="font-size: 14px; text-align: center;">${sp.marketPrice}</td>
						</tr>
					</c:forEach>
				</c:if>
			</table>
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-3 control-label">备注信息</label>
		<div class="col-sm-9">
			<input type="text" name="comment" value="${object.comment}"
				class="form-control" placeholder="备注信息" maxlength="13">
		</div>
	</div>




	<div class="row">
		<div class="col-lg-6">
			<button class="btn btn-primary col-sm-3 pull-right" type="submit"
				autocomplete="off">提交</button>
		</div>
		<div class="col-lg-6">
			<button class="btn btn-default col-sm-3 pull-left" type="button"
				onclick="javascript:editDialog.close();" autocomplete="off">取消</button>
		</div>
	</div>
	<input type="hidden" name="thumbOld" value="${object.storethumb}" /> <input
		type="hidden" name="thumbOldd" value="${object.busthumb}" /> <input
		type="hidden" name="id" value="${object.id}" /> <input type="hidden"
		name="stroeimagenum" value="${object.stroeimagenum}" />
</form>